package com.example.common.bean;


import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.stereotype.Component;

/**
 * 允许你在Spring容器实例化所有的Bean之前，对Bean的定义（BeanDefinition）进行自定义的修改和扩展
 */
@Component
public class PackBeanFactoryPostProcessor implements BeanFactoryPostProcessor {

    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        //BeanDefinition bd = beanFactory.getBeanDefinition("userService") ;
        //bd.getPropertyValues().addPropertyValue("name", "Pack") ;
    }
}
